<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //javascript对象
        const persons = [
            {
                pname:"张三",
                age:15
            },
            {
                pname:"李四",
                age:16
            }
        ]
        //存储
        localStorage.setItem("persons",JSON.stringify(persons));
        //获取s
        console.log(JSON.parse(localStorage.getItem("persons")));
    </script>
</body>
</html>